package com.wasion.pwportable.protocol.analyzer.indicator;

import com.wasion.pwportable.protocol.analyzer.AbstractAnalyzer;

/**
 * 
 * @ClassName: OverHeat_RD_Analyzer
 * @Description: 39.过温
 * @author 高意
 * @date 2014-9-11 上午9:48:01
 * 
 */
public class OverHeat_RD_Analyzer extends AbstractAnalyzer {

	@Override
	public void dataAnalysis(String ackBS) {

		String data = ackBS.substring(DATABITSTART, DATABITSTART + 20);

		String preTemp = data.substring(2, 4) + data.substring(0, 2);
		String faultTemp = data.substring(6, 8) + data.substring(4, 6);
		// String duration = data.substring(10, 12) + data.substring(8, 10);
		String duration = data.substring(8, 12);
		String time = data.substring(12, 20);

		result.setPreTemp(getTemperature(preTemp));
		result.setFaultTemp(getTemperature(faultTemp));
		result.setDuration(Integer.parseInt(duration, 16));
		result.setOccurTime(getIndicatorDate(time));
	}
}
